<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var arr = [1,2,3,4,5];
        arr[10]=50;
        //用for each遍历数组
        arr.forEach(function(e){
            console.log(e);
        })
        //箭头函数:(...)=>{...} --简化函数定义
        arr.forEach((e) => {
            console.log(e);
   } )
   console.log(arr.length)
   arr.push(6,7,8);
   console.log(arr);
   console.log(arr.length)
    </script>
</body>
</html>